Accelerometers and other types of sensors often include one or more crystal oscillators that produce a signal having a frequency that varies as a function of a measured parameter, such as acceleration. The frequency of this signal can be determined simply by counting the number of cycles of the signal occurring during a sample time of known duration. However, instrumentation used to monitor the frequency of a crystal oscillator in applications requiring high resolution typically "counts the frequency" in terms of cycles of a reference clock operating at a much higher frequency than the sensor crystal and thus avoids having to measure frequency over unacceptably long sample periods. The signal produced by a quartz crystal is sinusoidal and is usually converted to a square wave of equivalent frequency before being counted by the instrumentation. The frequency-counting instrumentation typically includes a counter that accumulates reference clock cycles during one or more periods of the square wave signal, where each such period extends from a rising edge to a rising edge, or from a falling edge to a falling edge of the square wave. Even better resolution of the signal frequency is achieved in real time, during continuous frequency monitoring, by using a combination of the two techniques, i.e., by counting integer numbers of cycles of the sensor signal that start during a sample time and correcting the integer number for any fractional portions of the sensor period that occur at the beginning and at the end of the sample time. The fractional portions of the sensor period are determined by counting cycles of the reference clock on additional counters
Commonly assigned U.S. Pat. No. 4,786,861 discloses a frequency-counting apparatus and method that uses an integer cycle counter in combination with counters that determine fractional portions of a sensor signal to achieve high resolution. The integer counter accumulates the total number of sensor periods or cycles that begin during a sample time. A partial period counter accumulates reference clock cycles during the portion of a sensor signal period or cycle that immediately follows the end of a sample time, and a full period counter determines the number of reference clock cycles that occurred during that entire sensor signal period or cycle, starting from just prior to the end of the sample time. The ratio of these two counts, i.e., the partial count divided by the full count, defines a fractional portion of the sensor signal period or cycle that is subtracted from the integer cycle count. In addition, a fractional portion of the sensor signal period, which was determined at the end of the last sample time and stored, is added to the result, yielding a corrected total count for the sample time. The frequency of the sensor signal is then determined simply by dividing the corrected total count by the known sample time.
An exemplary prior art crystal oscillator circuit 10 of the type used in an accelerometer is shown in FIG. 1. One of the problems associated with this circuit is its susceptibility to duty cycle modulation errors. A quartz crystal 12 in the circuit generates a periodically varying sinusoidal piezoelectric current having a frequency that changes as a function of a measured parameter, e.g., acceleration. The current produced by quartz crystal 12 is applied to the input of a high-impedance amplifier 14, comprising a complementary metal oxide semiconductor (CMOS) inverter 16 and a high-impedance (resistance greater than 100 Kohms) feedback resistor 18. The output of inverter 16 is applied to another CMOS inverter 20, which further shapes the signal so that a square wave signal 34 is output from the oscillator. The output signal is connected back to quartz crystal 12 through a resistor 22 and referenced to ground by a resistor 24. High-impedance amplifier 14 operates around a switch point level that is equal to about one-half of the power supply voltage (power supply not shown). The duty cycle of the square wave signal output from oscillator circuit 10 is thus readily affected by noise modulation of the sinusoidal signal developed by quartz crystal 12 and/or by the stability of the power supply voltage.
Noise modulation of the signal from quartz crystal 12 can occur due to pickup of stray electromagnetic interference (EMI), for example, from the AC line, or as a result of capacitive coupling of other signals to the signal produced by the quartz crystal. Variations in the DC power supply level can also modulate the duty cycle of the output square wave in an analogous manner. Such power supply modulation is relatively common, since small changes in the DC level of the power supply can occur even if a voltage regulator is used in the power supply.
FIG. 2 illustrates how a lower frequency noise signal superimposed on the sinusoidal signal from quartz crystal 12 (or variations in the DC voltage of the power supply) causes duty cycle modulation of the square wave output signal from oscillator circuit 10. The combined signal 30, representing the sum of the noise and quartz crystal signals, crosses a switch point level 32 of high-impedance amplifier 14 at varying, spaced-apart intervals, t.sub.1 -t.sub.n, during each cycle. At each point in time where combined signal 30 crosses switch point level 32, a change in the output signal occurs, corresponding to either a rising edge 36 or a falling edge 38, thereby producing square wave output signal 34. Thus, the duty cycle of the resulting square wave signal varies from cycle to cycle, as indicated by the variation between successive values of x.sub.i. Similarly, even in the absence of noise, variations in power supply voltage changes switch point level 32 of high-impedance amplifier 14, producing a comparable variation in duty cycle by varying the time intervals t.sub.1 -t.sub.n between which the sinusoidal signal crosses the switch point level. Since the frequency of the square wave output signal from oscillator circuit 10 is preferably, at least in part, determined by counting reference clock signals between successive rising edges OR between successive falling edges of the square wave output signal, it should be apparent that the duty cycle modulation of this signal in this manner contributes to an error in the overall determination of frequency.
Accordingly, it is an object of the present invention to eliminate, or at least minimize, errors in counting the frequency of a signal caused by duty cycle modulation. It is a further object to minimize the effect of noise modulation on counting the frequency of a signal. A still further object is to minimize the effect of variations in power supply voltage in circuitry that converts a sinusoidally varying signal to a square wave signal, particularly the effect on determining the frequency of the sinusoidal signal by counting reference clock cycles. These and other objects and advantages of the present invention will be apparent from the attached drawings and the Description of the Preferred Embodiments that follow.